<template>
  <div>
    <patients-desc :data="data" :isShow="isShow" @showList="showList" @close="close" :dataList="dataList"></patients-desc>
    <patients-table :data="data" @showList="showList"></patients-table>
  </div>
</template>

<script>
import patientsDesc from './components/patients-Desc.vue'
import patientsTable from './components/patients-Table.vue'
export default {
  components: { patientsTable, patientsDesc },
  data() {
    return {
      data: [
        {
          date: '2022-01-01',
          doctor: '张三',
          diagnosis: '感冒',
          prescription: '感冒药',
        },
        {
          date: '2022-02-01',
          doctor: '李四',
          diagnosis: '头疼',
          prescription: '止疼药',
        },
        {
          date: '2022-03-01',
          doctor: '王五',
          diagnosis: '腰痛',
          prescription: '止痛贴',
        },
      ],
      isShow: false,
      dataList: [],
    }
  },
  methods: {
    showList(item) {
      this.dataList = [item];
      this.isShow = true
      // console.log(this.dataList)
    },
    close(){
      this.isShow = false
    }
  },
}
</script>

<style>
</style>